package com.hddf.project.dao;

import java.util.List;

import org.hibernate.Session;

import com.hddf.project.pojos.SecondCategory;

public interface SecondCategoryDao {

	/**
	 * 添加二级类别
	 * 
	 * @param sc
	 * @param s
	 */
	public void add(SecondCategory sc, Session s) throws Exception;

	/**
	 * 删除二级类别
	 * 
	 * @param second_category_id
	 * @param s
	 */
	public void delete(int second_category_id, Session s) throws Exception;

	/**
	 * 删除二级类别
	 * 
	 * @param sc
	 * @param s
	 */
	public void delete(SecondCategory sc, Session s) throws Exception;

	/**
	 * 修改二级类别
	 * 
	 * @param sc
	 * @param s
	 */
	public void update(SecondCategory sc, Session s) throws Exception;

	/**
	 * 获取指定二级类别
	 * 
	 * @param second_category_id
	 * @param s
	 * @return
	 */
	public SecondCategory get(int second_category_id, Session s) throws Exception;

	/**
	 * 根据名称获取二级类别
	 * 
	 * @param name
	 * @param s
	 * @return
	 */
	public SecondCategory getByName(String name, Session s) throws Exception;

	/**
	 * 获取全部二级类别
	 * 
	 * @param s
	 * @return
	 */
	public List<SecondCategory> getList(Session s) throws Exception;

	/**
	 * 根据一级类别ID获取二级子类别
	 * 
	 * @param first_category_id
	 * @param s
	 * @return
	 */
	public List<SecondCategory> getListByFirstCategory(int first_category_id, Session s);

	/**
	 * 根据一级类别ID获取小于等于排序数的二级子类别
	 * 
	 * @param first_category_id
	 * @param s
	 * @return
	 */
	public List<SecondCategory> listSecondCategory(int first_category_id, int sort, Session s);

}
